home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Dylan Related / Mindy / Mindy 1.2 - portable sources / interp / module.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-15  |  3.5 KB  |  112 lines  |  [TEXT/ttxt]

  1. /**********************************************************************\
  2. *
  3. *  Copyright (c) 1994  Carnegie Mellon University
  4. *  All rights reserved.
  5. *  
  6. *  Use and copying of this software and preparation of derivative
  7. *  works based on this software are permitted, including commercial
  8. *  use, provided that the following conditions are observed:
  9. *  
  10. *  1. This copyright notice must be retained in full on any copies
  11. *     and on appropriate parts of any derivative works.
  12. *  2. Documentation (paper or online) accompanying any system that
  13. *     incorporates this software, or any part of it, must acknowledge
  14. *     the contribution of the Gwydion Project at Carnegie Mellon
  15. *     University.
  16. *  
  17. *  This software is made available "as is".  Neither the authors nor
  18. *  Carnegie Mellon University make any warranty about the software,
  19. *  its performance, or its conformity to any specification.
  20. *  
  21. *  Bug reports, questions, comments, and suggestions should be sent by
  22. *  E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
  23. *
  24. ***********************************************************************
  25. *
  26. * $Header: module.h,v 1.6 94/11/28 07:54:28 wlott Exp $
  27. *
  28. \**********************************************************************/
  29.  
  30.  
  31. extern obj_t obj_Unbound;
  32.  
  33. struct use {
  34.     /* The name of the thing being used. */
  35.     obj_t name;
  36.  
  37.     /* Either #t or a list of the names to import.  Duplicates and names */
  38.     /* listed in the rename list should be removed. */
  39.     obj_t import;
  40.  
  41.     /* Either #f or a string to prepend each imported name with. */
  42.     obj_t prefix;
  43.  
  44.     /* A list of names not to include when import is #t.  Duplicates */
  45.     /* should be removed.  If import is not #t, then this should be empty. */
  46.     obj_t exclude;
  47.  
  48.     /* A list of pair(orig_name, local_name) for renamings that override */
  49.     /* prefix.  These are taken in addition to import, and should not */
  50.     /* duplicate names there. */
  51.     obj_t rename;
  52.  
  53.     /* A list of local names to re-export, or #t for all imported names. */
  54.     obj_t export;
  55.  
  56.     /* The next use in this defn. */
  57.     struct use *next;
  58. };
  59.  
  60. struct defn {
  61.     /* Name of the thing this is the defn for. */
  62.     obj_t name;
  63.  
  64.     /* Chain of use structures. */
  65.     struct use *use;
  66.  
  67.     /* List of names in the export and create options. */
  68.     obj_t exports;
  69.     obj_t creates; /* Not used in libraries. */
  70. };
  71.  
  72. extern void define_library(struct defn *defn);
  73. extern struct library *find_library(obj_t name, boolean createp);
  74.  
  75. extern void define_module(struct library *library, struct defn *defn);
  76. extern struct module *find_module(struct library *library, obj_t name,
  77.                   boolean lose_if_not_there,
  78.                   boolean lose_if_imported);
  79.  
  80. enum var_kind {
  81.     var_Assumed, var_AssumedWriteable,
  82.     var_Constant, var_Variable, var_Class,
  83.     var_GenericFunction, var_Method
  84. };
  85.  
  86. extern void define_variable(struct module *module, obj_t name,
  87.                 enum var_kind kind);
  88.  
  89. struct variable {
  90.     obj_t name;
  91.     struct module *home;
  92.     boolean defined;
  93.     enum var_kind kind;
  94.     obj_t value;
  95.     obj_t type;
  96.     enum { func_Yes, func_No, func_Maybe, func_Always } function;
  97.     obj_t ref_file;
  98.     int ref_line;
  99. };
  100.  
  101. extern struct variable *find_variable(struct module *module, obj_t name,
  102.                       boolean writeable, boolean createp);
  103.  
  104. extern struct module *module_BuiltinStuff;
  105.  
  106. extern void list_libraries(void);
  107. extern obj_t library_name(struct library *library);
  108. extern void list_modules(struct library *library);
  109. extern obj_t module_name(struct module *module);
  110.  
  111. extern void finalize_modules(void);
  112.